<?
               if ($this->ad['type'] == 1) {
                    $ad_type_txt = 'give';
                }

                if ($this->ad['type'] == 2) {
                    $ad_type_txt = 'want';
                }

?>

<div id="default_header_section">
<h5>
<a href="/<?=$this->lang ?>/woeid/<?=$this->ad['woeid_code'].'/'.$ad_type_txt?>">
           <?=$this->woeidName.' > '. $this->translate((string)$ad_type_txt) ?></a>
</h5>
<h3><?=$this->ad['title'] ?></h3>
</div>


<?
if (count ( $this->mensajes ) > 0) {
	echo '<div class="success">';
	foreach ( $this->mensajes as $msg ) {
		echo $msg . '<br>';
	}
	echo '</div>';
}
?>


<div id="main">
<div class="span-15">


<?php
// if you are the ad owner or admin, then show edit link
$auth = Zend_Auth::getInstance ();
 if ( ($this->ad['user_owner'] == $auth->getIdentity()->id)  || ($this->userRole == 1) ): ?>
    <div class="edit_ad">
        <a href="/<?=$this->lang ?>/ad/edit/id/<?=$this->ad['id'] ?>">
            <img alt="<?=$this->translate('Edit this ad') ?>" src="/images/edit_ad.png"/>&nbsp;<?=$this->translate('Edit this ad') ?></a></div>
<?php endif;?>

       
        <div class="ad_excerpt_show">
          
           <?php
	   if ($this->ad['photo'] !== null){
		      echo '<div class="ad_list_image">
		      <a title="'.$this->translate('Click to enlarge photo').'" href="/images/uploads/ads/original/'.$this->ad['photo'].'" rel="superbox[image]">
		      <img alt="'.$this->ad['title'].'" src="/images/uploads/ads/100/'.$this->ad['photo'].'" /></a></div>';
	   }
	   ?>

           <?php if ($this->ad['type'] == 1): ?>
           <span class="ad_status <?=$this->ad['status'] ?>"><?=$this->translate($this->ad['status']) ?></span>
           <?php endif;?>

           <span class="ad_date"><?=$this->translate('Posted on '). $this->ad['date_created'] ?>
            <?=$this->translate('by user ') ?> 
            <a href="/<?=$this->lang ?>/ad/listuser/id/<?=$this->ad['user_owner'] ?>"><?=$this->ad['username'] ?></a>
            </span>
            
           <br>
           <p><?php echo $this->escapeEmail( $this->escape($this->ad['body']) ) ?></p>


           <div class="ad_meta_info">
               <?=$this->countReadedAd['counter'] . ' ' .$this->translate('readings') ?>

                <?php if ($this->checkCountAd): ?>
                 <?=', '.$this->escape( $this->checkCountAd == null  ? 0 : $this->checkCountAd ).' '.$this->translate('comments') ?>
                 <?php endif;?>
           </div>

           <div class="sharelinks"><?=$this->translate('Share this ad:');?>
            <a href="http://www.facebook.com/share.php?u=http://nolotiro.org/<?=$this->lang;?>/ad/show/id/<?=$this->ad['id'].'/'.$this->escape($this->ad['title']);?>">
                <img alt="<?=$this->translate('share on facebook');?>" src="/images/icons/ico_facebook.gif" border = "0"/></a>
                <a href="mailto:?subject=<?=$this->ad['title'];?>&body=http://nolotiro.org/<?=$this->lang;?>/ad/show/id/<?=$this->ad['id'].'/'.$this->escape($this->ad['title']);?>">
                <img alt="<?=$this->translate('send by email');?>" src="/images/icons/ico_email_link.png" border = "0"/></a>
                <a href="http://twitter.com/home?status=http://nolotiro.org/<?=$this->lang;?>/ad/show/id/<?=$this->ad['id'].'/'.$this->escape($this->ad['title']);?>">
                <img alt="<?=$this->translate('share on twitter');?>" src="/images/icons/ico_twitter.png" border = "0"/></a>
        </div>
           <?php if ($this->ad['status'] != 'delivered'): ?>
	   <?=$this->translate('Interested?') ?>&nbsp;
<a href="/<?=$this->lang ?>/message/create/id_user_to/<?=$this->ad['user_owner'].'/subject/'.$this->escape($this->ad['title'])
        ?>"><?=$this->translate('Send a private message to the owner') ?> <img src="/images/email_send.png" alt="send a message"/></a>
           <?php endif;?>
</div>

<? if ($this->ad['comments_enabled'] ): ?>
    <? if ($this->comments ): ?>
<div class="ad_comments">
<h5><?=$this->translate ( 'Comments');?></h5>

       <?php foreach ($this->comments as $key => $val): ?>
        <div class="ad_comment">
           <h4><a href="/<?=$this->lang ?>/ad/show/id/<?=$this->escape($val['id']).'/'.$this->escape($val['title']) ?>">
           <?=$this->escape($val['title']) ?></a></h4>
           
           <span class="ad_date"><?=$this->translate('Posted on '). $this->escape($val['date_created']) ?>
            <?=$this->translate('by user ') ?>            
                <a href="/<?=$this->lang ?>/profile/<?=$this->escape($val['username']) ?>"><?=$this->escape($val['username']) ?></a>
            </span>
           <br>
           <span><?php echo $this->escapeEmail( $this->escape($val['body']) ) ?></span>
        </div>
        
        <?php endforeach; ?>
<?php endif;?>



        <?php if($this->ad['status'] != 'delivered' ): ?>
        <div class="ad_comment_form">
        <?=$this->createcomment?>
        <?php endif; ?>
        </div>

<?php endif;?>

</div>

</div><!--end main -->
<!-- google adsense block -->
<div class="google_ads">
<script type="text/javascript"><!--
google_ad_client = "pub-7190437604389924";
/* 300x250, creado 9/01/10 */
google_ad_slot = "7269761465";
google_ad_width = 300;
google_ad_height = 250;
//-->
</script>
<script type="text/javascript"
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
</script>
</div>
<!-- end of google adsense block -->